<?php /* Smarty version 2.6.26, created on 2016-08-26 11:08:08
         compiled from index.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'index.html', 24, false),array('modifier', 'default', 'index.html', 27, false),array('modifier', 'upper', 'index.html', 30, false),array('modifier', 'lower', 'index.html', 30, false),array('modifier', 'truncate', 'index.html', 32, false),)), $this); ?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>我是模板文件</title>
	</head>
	<body>
		<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "head.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
		<?php echo $this->_tpl_vars['data']['name']; ?>

		<hr />
		<?php echo $this->_tpl_vars['data']['info']['url']; ?>

		<hr />
		<!--我是注释-->
				<?php echo $_GET['page']; ?>

		<hr />
		<!--常量调用-->
		<?php echo @APP; ?>

		<hr />
		<!--获取当前时间-->
		<?php echo time(); ?>

		<hr />
		<!--格式化时间戳-->
		<?php echo ((is_array($_tmp=time())) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d %H:%M:%S") : smarty_modifier_date_format($_tmp, "%Y-%m-%d %H:%M:%S")); ?>

		<hr />
				<?php echo ((is_array($_tmp=@$_GET['page'])) ? $this->_run_mod_handler('default', true, $_tmp, "我是page参数的默认值") : smarty_modifier_default($_tmp, "我是page参数的默认值")); ?>

		<hr />
				<?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['letter'])) ? $this->_run_mod_handler('upper', true, $_tmp) : smarty_modifier_upper($_tmp)))) ? $this->_run_mod_handler('lower', true, $_tmp) : smarty_modifier_lower($_tmp)); ?>

		<hr />
		<?php echo ((is_array($_tmp=$this->_tpl_vars['letter'])) ? $this->_run_mod_handler('truncate', true, $_tmp, 5, "") : smarty_modifier_truncate($_tmp, 5, "")); ?>

		<hr />
		<?php echo '
			{if $data.name=="小红" && $data.age==19}
				我才是小红
			{else}
				我是小绿
			{/if}
		'; ?>

		<hr />
		<table border="1" >
			<tr>
				<th>学生姓名</th>
				<th>性别</th>
				<th>年龄</th>
			</tr>
			<?php $_from = $this->_tpl_vars['stuData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
?>
			<tr>
				<td><?php echo $this->_tpl_vars['v']['name']; ?>
</td>
				<td><?php echo $this->_tpl_vars['v']['sex']; ?>
</td>
				<td><?php echo $this->_tpl_vars['v']['age']; ?>
</td>
			</tr>
			<?php endforeach; endif; unset($_from); ?>
		</table>
		<hr />
		<table border="1" >
			<tr>
				<th>学生姓名</th>
				<th>性别</th>
				<th>年龄</th>
			</tr>
			<?php unset($this->_sections['m']);
$this->_sections['m']['loop'] = is_array($_loop=$this->_tpl_vars['stuData']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['m']['name'] = 'm';
$this->_sections['m']['start'] = (int)1;
$this->_sections['m']['step'] = ((int)3) == 0 ? 1 : (int)3;
$this->_sections['m']['max'] = (int)5;
$this->_sections['m']['show'] = true;
if ($this->_sections['m']['max'] < 0)
    $this->_sections['m']['max'] = $this->_sections['m']['loop'];
if ($this->_sections['m']['start'] < 0)
    $this->_sections['m']['start'] = max($this->_sections['m']['step'] > 0 ? 0 : -1, $this->_sections['m']['loop'] + $this->_sections['m']['start']);
else
    $this->_sections['m']['start'] = min($this->_sections['m']['start'], $this->_sections['m']['step'] > 0 ? $this->_sections['m']['loop'] : $this->_sections['m']['loop']-1);
if ($this->_sections['m']['show']) {
    $this->_sections['m']['total'] = min(ceil(($this->_sections['m']['step'] > 0 ? $this->_sections['m']['loop'] - $this->_sections['m']['start'] : $this->_sections['m']['start']+1)/abs($this->_sections['m']['step'])), $this->_sections['m']['max']);
    if ($this->_sections['m']['total'] == 0)
        $this->_sections['m']['show'] = false;
} else
    $this->_sections['m']['total'] = 0;
if ($this->_sections['m']['show']):

            for ($this->_sections['m']['index'] = $this->_sections['m']['start'], $this->_sections['m']['iteration'] = 1;
                 $this->_sections['m']['iteration'] <= $this->_sections['m']['total'];
                 $this->_sections['m']['index'] += $this->_sections['m']['step'], $this->_sections['m']['iteration']++):
$this->_sections['m']['rownum'] = $this->_sections['m']['iteration'];
$this->_sections['m']['index_prev'] = $this->_sections['m']['index'] - $this->_sections['m']['step'];
$this->_sections['m']['index_next'] = $this->_sections['m']['index'] + $this->_sections['m']['step'];
$this->_sections['m']['first']      = ($this->_sections['m']['iteration'] == 1);
$this->_sections['m']['last']       = ($this->_sections['m']['iteration'] == $this->_sections['m']['total']);
?>
			<tr>
				<td><?php echo $this->_tpl_vars['stuData'][$this->_sections['m']['index']]['name']; ?>
</td>
				<td><?php echo $this->_tpl_vars['stuData'][$this->_sections['m']['index']]['sex']; ?>
</td>
				<td><?php echo $this->_tpl_vars['stuData'][$this->_sections['m']['index']]['age']; ?>
</td>
			</tr>
			<?php endfor; endif; ?>
		</table>
		<hr />
		<table border="1" >
			<tr>
				<th>学生姓名</th>
				<th>性别</th>
				<th>年龄</th>
			</tr>
			<?php unset($this->_sections['m']);
$this->_sections['m']['loop'] = is_array($_loop=$this->_tpl_vars['stuData']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['m']['name'] = 'm';
$this->_sections['m']['show'] = true;
$this->_sections['m']['max'] = $this->_sections['m']['loop'];
$this->_sections['m']['step'] = 1;
$this->_sections['m']['start'] = $this->_sections['m']['step'] > 0 ? 0 : $this->_sections['m']['loop']-1;
if ($this->_sections['m']['show']) {
    $this->_sections['m']['total'] = $this->_sections['m']['loop'];
    if ($this->_sections['m']['total'] == 0)
        $this->_sections['m']['show'] = false;
} else
    $this->_sections['m']['total'] = 0;
if ($this->_sections['m']['show']):

            for ($this->_sections['m']['index'] = $this->_sections['m']['start'], $this->_sections['m']['iteration'] = 1;
                 $this->_sections['m']['iteration'] <= $this->_sections['m']['total'];
                 $this->_sections['m']['index'] += $this->_sections['m']['step'], $this->_sections['m']['iteration']++):
$this->_sections['m']['rownum'] = $this->_sections['m']['iteration'];
$this->_sections['m']['index_prev'] = $this->_sections['m']['index'] - $this->_sections['m']['step'];
$this->_sections['m']['index_next'] = $this->_sections['m']['index'] + $this->_sections['m']['step'];
$this->_sections['m']['first']      = ($this->_sections['m']['iteration'] == 1);
$this->_sections['m']['last']       = ($this->_sections['m']['iteration'] == $this->_sections['m']['total']);
?>
				<?php if ($this->_sections['m']['last']): ?>
				<tr style="color: red;">
					<td><?php echo $this->_tpl_vars['stuData'][$this->_sections['m']['index']]['name']; ?>
</td>
					<td><?php echo $this->_tpl_vars['stuData'][$this->_sections['m']['index']]['sex']; ?>
</td>
					<td><?php echo $this->_tpl_vars['stuData'][$this->_sections['m']['index']]['age']; ?>
</td>
				</tr>
				<?php else: ?>
				<tr>
					<td><?php echo $this->_tpl_vars['stuData'][$this->_sections['m']['index']]['name']; ?>
</td>
					<td><?php echo $this->_tpl_vars['stuData'][$this->_sections['m']['index']]['sex']; ?>
</td>
					<td><?php echo $this->_tpl_vars['stuData'][$this->_sections['m']['index']]['age']; ?>
</td>
				</tr>
				<?php endif; ?>
			<?php endfor; endif; ?>
		</table>
		<hr />
		<table border="1" >
			<tr>
				<th>学生姓名</th>
				<th>性别</th>
				<th>年龄</th>
			</tr>
			<?php unset($this->_sections['m']);
$this->_sections['m']['loop'] = is_array($_loop=$this->_tpl_vars['stuData']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['m']['name'] = 'm';
$this->_sections['m']['show'] = true;
$this->_sections['m']['max'] = $this->_sections['m']['loop'];
$this->_sections['m']['step'] = 1;
$this->_sections['m']['start'] = $this->_sections['m']['step'] > 0 ? 0 : $this->_sections['m']['loop']-1;
if ($this->_sections['m']['show']) {
    $this->_sections['m']['total'] = $this->_sections['m']['loop'];
    if ($this->_sections['m']['total'] == 0)
        $this->_sections['m']['show'] = false;
} else
    $this->_sections['m']['total'] = 0;
if ($this->_sections['m']['show']):

            for ($this->_sections['m']['index'] = $this->_sections['m']['start'], $this->_sections['m']['iteration'] = 1;
                 $this->_sections['m']['iteration'] <= $this->_sections['m']['total'];
                 $this->_sections['m']['index'] += $this->_sections['m']['step'], $this->_sections['m']['iteration']++):
$this->_sections['m']['rownum'] = $this->_sections['m']['iteration'];
$this->_sections['m']['index_prev'] = $this->_sections['m']['index'] - $this->_sections['m']['step'];
$this->_sections['m']['index_next'] = $this->_sections['m']['index'] + $this->_sections['m']['step'];
$this->_sections['m']['first']      = ($this->_sections['m']['iteration'] == 1);
$this->_sections['m']['last']       = ($this->_sections['m']['iteration'] == $this->_sections['m']['total']);
?>
				<?php if ($this->_sections['m']['index'] <= 3): ?>
				<tr style="color: red;">
					<td><?php echo $this->_tpl_vars['stuData'][$this->_sections['m']['index']]['name']; ?>
</td>
					<td><?php echo $this->_tpl_vars['stuData'][$this->_sections['m']['index']]['sex']; ?>
</td>
					<td><?php echo $this->_tpl_vars['stuData'][$this->_sections['m']['index']]['age']; ?>
</td>
				</tr>
				<?php else: ?>
				<tr>
					<td><?php echo $this->_tpl_vars['stuData'][$this->_sections['m']['index']]['name']; ?>
</td>
					<td><?php echo $this->_tpl_vars['stuData'][$this->_sections['m']['index']]['sex']; ?>
</td>
					<td><?php echo $this->_tpl_vars['stuData'][$this->_sections['m']['index']]['age']; ?>
</td>
				</tr>
				<?php endif; ?>
			<?php endfor; endif; ?>
		</table>
		<hr />
		<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
	</body>
</html>